#include <iostream>
#include <deque>
namespace jib
{
	template<class T, class Con = std::deque<T>>
	class stack
	{
	public:
		stack()
		{}
		void push(const T& x)
		{
			_c.push_back(x);
		}
		T& top() 
		{
			return _c.back();
		}
		const T& top() const
		{
			return _c.back();
		}
		void pop()
		{
			_c.pop_back();
		}
		size_t size() const
		{
			return _c.size();
		}
		bool empty()
		{
			return _c.empty();
		}
	private:
		Con _c;
	};
	template<class T, class Con = std::deque<T>>
	class queue
	{
	public:
		queue()
		{}
		void push(const T& x)
		{
			_c.push_back(x);
		}
		T& front()
		{
			return _c.front();
		}
		const T& front() const
		{
			return _c.front();
		}
		T& back()
		{
			return _c.back();
		}
		const T& back() const
		{
			return _c.back();
		}
		void pop()
		{
			_c.pop_front();
		}
		bool empty()
		{
			return _c.empty();
		}
	private:
		Con _c;
	};
}
int main()
{
	jib::stack<int> s1;
	s1.push(2);
	s1.pop();
	std::cout << s1.empty() << std::endl;
	jib::queue<int> s2;
	s2.push(3);
	s2.push(4);
	while (!s2.empty())
	{
		std::cout << s2.front();
		s2.pop();
	}
	return 0;
}